<style type="text/css">
    .bckcolor {
        background-color: #FF0000;

    }

    .edition_click {
        background-color: greenyellow;
    }
    .switch{
        width: 28px;
        height: 14px;
    }
    .switch small{
        width: 14px;
        height: 14px;
    }
    .switch.checked small{
        left: 13px;
    }
    .dropdown-menu {
        max-height: 303px;
    }
</style>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <span>{{info.selectIntegration}}&nbsp;&nbsp;&nbsp;&nbsp;{{info.integrationInfo.integration_date}}至{{info.integrationInfo.online_date}}</span>
                    <i class="glyphicon glyphicon-plus" ng-if="isModifiAble();" uib-popover="为集成计划添加项目"
                       popover-trigger="mouseenter" ng-click="addPlan();"
                       style="font-size: 20px;margin-left: 40px;"></i>

                    <button class="btn btn-info" style="margin-left: 2%"
                            ng-if="info.integrationInfo.integration_status == 'INTEGRATIONING' && info.integrationInfo.isEmergency == '1'"
                            ng-click="goUcRelease();">进入集成环境
                    </button>

                    <button class="btn btn-info" style="margin-left: 3%" ng-click="goBack('integrationSet_go_back');"
                            ng-show="showGoBack('integrationSet_go_back');">返回
                    </button>
                    <span style="margin-left: 20%;" ng-if="info.tabIndex == 2">
                        <span ng-if="info.AutoDrawSqlStatus != null">
                            抽取状态: {{info.AutoDrawSqlStatus.status}}&nbsp;&nbsp;&nbsp;&nbsp;
                            最后抽取时间: {{info.AutoDrawSqlStatus.date}}
                        </span>
                        <span ng-if="info.AutoDrawSqlStatus == null">
                            未抽取
                        </span>
                        <button class="btn btn-primary" style="margin-left: 1%;" type="button"
                                uib-popover="从svn获取所有工程代码,并抽取工程sql文件至指定目录"
                                popover-trigger="mouseenter" ng-click="drawSqlFromProject();"
                                ng-disabled="info.AutoDrawSqlStatus != null && info.AutoDrawSqlStatus.status == 'running'">
                            更新sql列表
                        </button>
                    </span>
                </div>
                <div class="box-body" style="margin-top:1px;">
                    <ul id="myTab" class="nav nav-tabs">
                        <li class="" data-ng-repeat="tab in info.tabs track by $index"
                            ng-class="{true:'active',false:''}[tab.index==info.tabIndex]">
                            <a style="cursor: pointer;" ng-click="tabClick(tab.index);" data-toggle="tab">
                                {{tab.name}}</a>
                        </li>
                    </ul>
                    <div id="myTabContent" class="tab-content">
                        <!--工程列表-->
                        <div class="tab-pane fade" id="tab0" ng-class="{true:'in active',false:''}[info.tabIndex == 0]">
                            <br>
                            <input type="checkbox" data-ng-model="info.isHideMergePro" ng-change="getProjectList();"
                                   ng-true-value="true" ng-false-value="false"/>
                            <span>隐藏被合并的分支</span>
                            <span style="padding-left: 5%;">共<span
                                    style="color: blue;">{{info.projectList.length}}</span>个工程,其中上线工程<span
                                    style="color: red;">{{info.toOnlineProCount}}</span>个,依赖jar工程<span
                                    style="color: blue;">{{info.jarProCount}}</span>个</span>
                            <span ng-if="!info.isHideMergePro">,被合并工程<span
                                    style="color: blue;">{{info.merageProCount}}</span>个</span>
                            <br>
                            <br>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="2%"></th>
                                    <th width="5%">操作</th>
                                    <th width="10%">项目</th>
                                    <th width="5%">工程</th>
                                    <th width="10%">分支</th>
                                    <th width="10%">申请集成版本</th>
                                    <th width="10%">可集成版本</th>
                                    <th width="10%">当前集成版本</th>
                                    <th width="10%">交付版本</th>
                                    <th width="10%">状态</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr class="item" data-ng-repeat="project in info.projectList track by $index">
                                    <td>{{$index+1}}</td>
                                    <td>
                                        <i ng-show="project.to_integration_edition != null"
                                           class="glyphicon glyphicon-list" uib-popover="查看申请转测记录"
                                           ng-click="getToIntegrationRecord(project);" popover-trigger="mouseenter"
                                           style="font-size: 20px;"></i>
                                        <i ng-hide="project.to_integration_edition != null"
                                           class="glyphicon glyphicon-list" uib-popover="查看申请转测记录"
                                           popover-trigger="mouseenter" style="font-size: 20px;color: grey;"></i>
                                        <i ng-show="isModifiAble() && project.project_status == 'HAND_OVER' && project.hand_over_edition != null"
                                           class="glyphicon glyphicon-ban-circle" uib-popover="取消交付"
                                           ng-click="cancelHandOver(project);" popover-trigger="mouseenter"
                                           style="font-size: 20px;"></i>
                                        <i ng-hide="isModifiAble() && project.project_status == 'HAND_OVER' && project.hand_over_edition != null"
                                           class="glyphicon glyphicon-ban-circle" uib-popover="取消交付"
                                           popover-trigger="mouseenter" style="font-size: 20px;color: grey;"></i>
                                    </td>
                                    <td>{{project.plan_name}}</td>
                                    <td>{{project.trunk_name}}</td>
                                    <td>
                                        <span ng-if="project.isOnBeetle == '0'">
                                            {{project.project_name}}
                                        </span>
                                    </td>
                                    <td>
                                        <span ng-if="project.package_type == 'maven_jar'">——无——</span>
                                        <span ng-if="!getEditionPath(project,project.to_integration_edition);">{{project.to_integration_edition}}</span>
                                        <span ng-if="getEditionPath(project,project.to_integration_edition);">
                                            <a href="javascript:void(0)" class="btn-link" popover-title="版本nas路径"
                                               type="button"
                                               popover-trigger="outsideClick" uib-popover="{{project.tip}}">
                                                {{project.to_integration_edition}}</a>
                                        </span>
                                        <div style="float: right;margin-right: 10px;"
                                             ng-if="isModifiAble() && project.to_integration_edition != null && project.to_integration_edition != project.integration_edition">
                                            <img style="width: 40px;height: 15px;vertical-align:baseline;"
                                                 src="/beetle/image/new.gif"
                                                 uib-popover="有新版本申请集成,请处理!" popover-trigger="mouseenter"
                                                 ng-click="proToIntegration(project);"/>
                                        </div>
                                    </td>
                                    <td>
                                        <span ng-if="project.package_type == 'maven_jar'">——无——</span>
                                        {{project.integration_edition}}
                                    </td>
                                    <td>
                                        <span ng-if="project.package_type == 'maven_jar'">——无——</span>
                                        {{project.integrationing_edition}}
                                    </td>
                                    <td>
                                        <span ng-if="project.package_type == 'maven_jar'">——无——</span>
                                        {{project.hand_over_edition}}
                                    </td>
                                    <td>
                                        {{getStatusDesc(project.project_status)}}
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <!--项目列表-->
                        <div class="tab-pane fade" id="tab1" ng-class="{true:'in active',false:''}[info.tabIndex == 1]">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="10%">项目名称</th>
                                    <th width="15%">负责人</th>
                                    <th width="10%" ng-if="isModifiAble()">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr class="item" data-ng-repeat="plan in info.planList track by $index">
                                    <td>
                                        <a href="javascript:void(0);" ng-click="toPlan(plan)">
                                            {{plan.plan_name}}
                                        </a>

                                    </td>
                                    <td>{{plan.PM_name}}</td>
                                    <td ng-if="isModifiAble()">
                                        <a ng-if="isModifiAble() && plan.isDisable" href="javascript:void(0)"
                                           ng-click="cancelPlan(plan);">撤下</a>
                                        <span ng-if="!plan.isDisable">主干不可撤下</span>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <!--配置文件描述-->
                        <div class="tab-pane fade" id="tab2" ng-class="{true:'in active',false:''}[info.tabIndex == 2]">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="5%">主干名称</th>
                                    <th width="10%">分支名称</th>
                                    <th width="20%">配置描述</th>
                                    <th width="10%">SQL脚本</th>
                                    <th width="5%">抽取SQL文件状态</th>
                                    <th width="5%">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr class="item" data-ng-repeat="pro in info.projectList track by $index">
                                    <td>{{pro.trunk_name}}</td>
                                    <td>{{pro.project_name}}</td>
                                    <td style="word-break:break-all;">
                                        <span data-ng-repeat="c in pro.configList track by $index" ng-if="c.isDel=='0'"
                                              style="font-size: 10px;">
                                            文件: <span style="color: #00a7d0;">{{c.file_name}}</span>&nbsp;&nbsp;&nbsp;
                                            <span ng-if="c.type == '1'" style="margin-right: 5px;color: red;">新增</span>
                                            <span ng-if="c.type == '2'" style="margin-right: 5px;color: red;">删除</span>
                                            <span ng-if="c.type == '3'" style="margin-right: 5px;color: red;">修改</span>
                                            {{c.desc}}:&nbsp;&nbsp;&nbsp;&nbsp;{{c.key}}={{c.value}}。
                                            资源类型: <span style="color: #00a7d0;">{{c.config_type}}</span>。取值:<span
                                                style="color: #00a7d0;">{{c.value_from}}</span>
                                            <input type="checkbox" ng-disabled="!isModifiAble('ops')"
                                                   ng-show="isUserCanOperateByRole('plan_admin','pm','ops')"
                                                   style="margin-left: 10px;" ng-model="c.is_ops_check"
                                                   ng-click="checkConfig(c);" ng-true-value="0" ng-false-value="1"/>
                                            <br>
                                        </span>
                                    </td>
                                    <td>
                                        <span ng-if="info.AutoDrawSqlStatus != null && info.AutoDrawSqlStatus.status == 'running'">抽取中...</span>
                                        <span ng-if="info.AutoDrawSqlStatus != null && info.AutoDrawSqlStatus.status != 'running'">
                                            <span data-ng-repeat="s in pro.sqlList track by $index" ng-if="!s.isDel">
                                                <a href="javascript:void(0)"
                                                   ng-click="downloadFile(s.file_name,s.file_path);"
                                                   title="下载文件">{{s.file_name}}</a>
                                                <span ng-if="s.is_upload == '0'">(手动上传)</span>
                                                <input type="checkbox" style="margin-left: 10px;"
                                                       ng-disabled="!isModifiAble('ops')"
                                                       ng-show="isUserCanOperateByRole('plan_admin','pm','ops')"
                                                       ng-model="s.is_dba_check" ng-click="checkSql(s);"
                                                       ng-true-value="0"
                                                       ng-false-value="1"/>
                                                <i ng-if="s.analyse.length != 0"
                                                   class="glyphicon glyphicon-warning-sign" ng-click="sqlAnalyse(s);"
                                                   uib-popover="sql中有修改表结构语句" popover-trigger="mouseenter"
                                                   style="color: red;float: right;"></i>
                                                <br>
                                            </span>
                                        </span>

                                    </td>
                                    <td>
                                        {{pro.sqlDesc}}
                                    </td>
                                    <td>
                                        <i class="glyphicon glyphicon-edit" ng-if="isModifiAble('dev')"
                                           uib-popover="编辑配置项" popover-trigger="mouseenter" ng-click="editConfig(pro);"
                                           style="font-size: 20px;"></i>
                                        <span ng-if="info.AutoDrawSqlStatus == null || info.AutoDrawSqlStatus.status != 'running'">
                                            <i class="glyphicon glyphicon-cloud-upload" ng-if="isModifiAble('dev')"
                                               uib-popover="上传SQL文件" popover-trigger="mouseenter"
                                               popover-placement="auto" ng-click="uploadSql(pro);"
                                               style="font-size: 20px;padding-left: 2%;"></i>
                                            <i class="glyphicon glyphicon-edit" ng-if="isModifiAble('dev')"
                                               uib-popover="编辑SQL文件" popover-trigger="mouseenter"
                                               popover-placement="auto" ng-click="editSql(pro);"
                                               style="font-size: 20px;padding-left: 2%;"></i>
                                            <i class="glyphicon glyphicon glyphicon-list"
                                               ng-if="pro.sqlRecord != undefined && pro.sqlRecord.length != 0"
                                               uib-popover="查看sql文件抽取记录" popover-trigger="mouseenter"
                                               popover-placement="auto" ng-click="sqlRecord(pro);"
                                               style="font-size: 20px;padding-left: 2%;"></i>
                                        </span>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <br>
                            <button ng-show="info.showDownLoadBtn" class="btn btn-primary" type="button"
                                    ng-disabled="info.AutoDrawSqlStatus == null || info.AutoDrawSqlStatus.status == 'running'"
                                    ng-click="downloadFilePackage();">打包下载
                            </button>
                        </div>
                        <!--上线时间规划-->
                        <div class="tab-pane fade" id="tab4" ng-class="{true:'in active',false:''}[info.tabIndex == 4]">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="10%">部署服务</th>
                                    <th width="15%">部署区域</th>
                                    <th width="15%">部署时间</th>
                                    <th width="10%">配置说明</th>
                                    <th width="10%">支持非停机发版</th>
                                    <th width="10%">db脚本</th>
                                    <th width="10%" colspan="2">负责人</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr class="item" data-ng-repeat="time in info.timeList track by $index">
                                    <td>{{time.trunk_name}}</td>
                                    <td>{{time.zone_code}}</td>
                                    <td>{{time.deploy_start_time}}--{{time.deploy_end_time}}</td>
                                    <td>
                                        <a ng-if="time.has_config" href="javascript:void(0);"
                                           ng-click="tabClick(2);">有</a>
                                        <span ng-if="!time.has_config">无</span>
                                    </td>
                                    <td>
                                        <span ng-if="time.hot_deploy">是</span>
                                        <span ng-if="!time.hot_deploy">否</span>
                                    </td>
                                    <td>
                                        <a ng-if="time.has_sql" href="javascript:void(0);" ng-click="tabClick(3);">有</a>
                                        <span ng-if="!time.has_sql">无</span>
                                    </td>
                                    <td>
                                        <span ng-if="!time.isModify">{{time.deployer_realname}}</span>
                                        <input type="text" ng-if="time.isModify" ng-model="time.userInfo"
                                               placeholder="Select User"
                                               uib-typeahead="user as user.realname for user in info.userList | filter:{realname:$viewValue}|limitTo:15"
                                               typeahead-template-url="selectTemplate.html" class="form-control"
                                               typeahead-show-hint="true" typeahead-min-length="0"
                                               typeahead-on-select="userSelect(time);" typeahead-select-on-blur="true">
                                    </td>
                                    <td>
                                        <a href="javascript:void(0);" ng-if="isModifiAble() && !time.isModify"
                                           ng-click="time.isModify = true">更改</a>
                                        <a href="javascript:void(0);" ng-if="time.isModify" ng-click="saveUser(time);">保存</a>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <!--集成计划上线描述-->
                        <div class="tab-pane fade" id="tab6" ng-class="{true:'in active',false:''}[info.tabIndex == 6]">
                            <i class="glyphicon glyphicon-plus" uib-popover="添加描述"
                               popover-trigger="mouseenter" ng-click="addOnlineDesc();"
                               style="font-size: 20px;margin-left: 40px;"></i>
                            <span style="margin-left: 1%;color: red;">
                                填写上线过程中的一些注意事项、备注等等.为避免跟其它人冲突,每个人都可以新增记录.编辑完成后,必须点击每行最后的保存按钮才能生效。
                            </span>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="1%">修改人</th>
                                    <th width="1%">修改时间</th>
                                    <th width="5%">描述</th>
                                    <th width="1%">文件</th>
                                    <th width="1%">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr class="item" data-ng-repeat="desc in info.onlineDescList track by $index">
                                    <td>{{desc.real_name}}</td>
                                    <td>{{desc.update_date|create_date_filter}}</td>
                                    <td>
                                        <textarea ng-hide="arrayContains(info.userRole,'ops')" wrap="off"
                                                  style="overflow-y:scroll;width: 80%;"
                                                  ng-model="desc.desc" rows="2"></textarea>
                                        <div ng-show="arrayContains(info.userRole,'ops')"
                                             ng-bind-html="desc.desc_str"></div>
                                    </td>
                                    <td>
                                        <a href="javascript:void(0)"
                                           ng-click="downloadFile(desc.file_name,desc.file_path);"
                                           title="下载文件">{{desc.file_name}}</a>
                                        <img src="/beetle/image/icon_trash.png"
                                             ng-if="desc.file_name != null && desc.file_name != ''"
                                             ng-click="delOnlineDescFile(desc);"
                                             style="cursor: pointer;width: 20px;float: right;">
                                    </td>
                                    <td>
                                        <i ng-hide="arrayContains(info.userRole,'ops')"
                                           class="glyphicon glyphicon-floppy-saved" uib-popover="保存描述信息"
                                           popover-trigger="mouseenter" ng-click="saveIntegrationDesc(desc);"
                                           style="font-size: 20px;"></i>
                                        <i class="glyphicon glyphicon-cloud-upload" ng-if="desc.id != null"
                                           uib-popover="上传文件" popover-trigger="mouseenter" popover-placement="auto"
                                           ng-click="uploadOnlineDescFile(desc);"
                                           style="font-size: 20px;padding-left: 2%;"></i>
                                    </td>
                                </tr>
                                </tbody>
                            </table>

                        </div>
                        <!--交付确认-->
                        <div class="tab-pane fade" id="tab5" ng-class="{true:'in active',false:''}[info.tabIndex == 5]">
                            <span>交付确认后, 会向运维组发送邮件通知, 准备发版staging环境.</span>
                            <br>
                            <br>
                            <span ng-if="info.integrationInfo.integration_status == 'INTEGRATIONING'">当前状态: 未交付</span>
                            <span ng-if="info.integrationInfo.integration_status == 'HAND_OVER'">当前状态: 已交付运维</span>
                            <span ng-if="info.integrationInfo.integration_status == 'ONLINE'">当前状态: 已上线</span>
                            <br>
                            <div ng-if="info.integrationInfo.integration_status == 'INTEGRATIONING'">
                                <input type="checkbox" data-ng-model="info.isChecked" ng-true-value="true"
                                       ng-disabled="!isModifiAble()"
                                       ng-false-value="false"/>
                                <span>作为项目负责人, 我已经检查过该计划上的所有信息, 确定无误.</span>
                                <br>
                                <button class="btn btn-default pull-left"
                                        ng-disabled="!info.isChecked || !isModifiAble()"
                                        data-ng-click="handOver();">交付上线计划
                                </button>
                            </div>
                            <br>
                            <br>
                            <br>
                            <h4>检索条件</h4>
                            <br>
                            <table class="table table-bordered">
                                <tr>
                                    <td>工程名:</td>
                                    <td>
                                        <input type="text" ng-model="info.filter.trunkName" style="width: 220px;"
                                               placeholder="Search Project Name Here..."/>
                                    </td>
                                    <td>角色:</td>
                                    <td>
                                        <select ng-model="info.filter.role">
                                            <option value="">全部</option>
                                            <option value="dev">开发</option>
                                            <option value="qa">测试</option>
                                            <option value="ops">运维</option>
                                            <option value="admin">管理员</option>
                                        </select>
                                    </td>
                                    <td>
                                        操作类型:
                                    </td>
                                    <td>
                                        <p style="display: inline-block; width: 10%;">
                                            <input type="checkbox" ng-model="info.filter.checkAll"
                                                   ng-click="checkAll();" ng-true-value="true" ng-false-value="false"/>
                                            <span style="margin-left: 2%;">全选</span>
                                        </p>
                                        <p style="display: inline-block; width: 10%;"
                                           ng-repeat="type in info.filter.type">
                                            <input type="checkbox" ng-model="type.check" ng-true-value="true"
                                                   ng-false-value="false"/>
                                            <span style="margin-left: 2%;">{{getOperateDesc(type.key)}}</span>
                                        </p>
                                    </td>
                                </tr>
                            </table>
                            <br>
                            <h4>更新列表</h4>
                            <br>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="10%">工程</th>
                                    <th width="10%">项目</th>
                                    <th width="10%">更新时间</th>
                                    <th width="10%">原分支</th>
                                    <th width="10%">原版本</th>
                                    <th width="10%">新分支</th>
                                    <th width="10%">新版本</th>
                                    <th width="10%">集成计划状态</th>
                                    <th width="5%">操作人</th>
                                    <th width="5%">角色</th>
                                    <th width="10%">操作类型</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr class="item" ng-repeat="update in info.updateList|updateListFilter:info.filter">
                                    <td>{{update.trunk_name}}</td>
                                    <td>{{update.plan_name}}</td>
                                    <td>{{update.create_date |create_date_filter}}</td>
                                    <td>{{update.old_project}}</td>
                                    <td>
                                        <span ng-hide="update.old_edition == null || update.old_edition == ''">{{update.old_edition}}</span>
                                        <span ng-show="update.old_edition == null || update.old_edition == ''">——</span>
                                    </td>
                                    <td>{{update.new_project}}</td>
                                    <td>
                                        <span ng-hide="update.new_edition == null || update.new_edition == ''">{{update.new_edition}}</span>
                                        <span ng-show="update.new_edition == null || update.new_edition == ''">——</span>
                                    </td>
                                    <td>{{getStatusDesc(update.integration_status)}}</td>
                                    <td>{{update.user_realname}}</td>
                                    <td>
                                        <span ng-if="update.user_role == 'dev'">开发</span>
                                        <span ng-if="update.user_role == 'qa'">测试</span>
                                        <span ng-if="update.user_role == 'ops'">运维</span>
                                        <span ng-if="update.user_role == 'admin'">管理员</span>
                                    </td>
                                    <td>{{getOperateDesc(update.key)}}</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <!--合并主干-->
                        <div class="tab-pane fade" id="tab7" ng-class="{true:'in active',false:''}[info.tabIndex == 7]">
                            <div>
                                点击按钮后的合并步骤:
                                <br>
                                1、erp\owms等不用beetle管理的工程不能自动合并,需要手动操作svn.
                                <br>
                                2、先判断分支的交付版本是否为当前工程的测试通过版本.(jar工程不需要交付版本)
                                <br>
                                3、将现有的trunk代码拷贝至tags目录,创建新tag.(svn copy)
                                <br>
                                4、检出当前trunk代码到本地,删除trunk下所有目录.(svn checkout && svn delete)
                                <br>
                                5、将上线分支的svn代码拷贝至检出的trunk目录下.(svn export && cp)
                                <br>
                                6、把maven工程pom文件的version里的SNAPSHOT修改为RELEASE.
                                <br>
                                7、将trunk下的代码添加至svn的trunk目录下.(svn add && svn commit)
                            </div>
                            <br>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="1%">操作</th>
                                    <th width="2%">工程</th>
                                    <th width="2%">交付版本</th>
                                    <th width="1%">合并状态</th>
                                    <th width="2%">合并时间</th>
                                    <th width="10%">描述</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr class="item" data-ng-repeat="project in info.projectList track by $index">
                                    <td>
                                        <i ng-show="project.isOnBeetle == '0'" ng-click="mergeToTrunk(project);"
                                           class="glyphicon glyphicon-random" uib-popover="合并当前分支到svn主干"
                                           popover-trigger="mouseenter" popover-placement="auto"
                                           style="font-size: 20px;cursor: pointer;"></i>
                                    </td>
                                    <td>
                                        {{project.project_name}}
                                    </td>
                                    <td>
                                        <span ng-if="project.package_type == 'maven_jar'">默认版本</span>
                                        <span ng-if="project.package_type != 'maven_jar'">{{project.hand_over_edition}}</span>
                                    </td>
                                    <td>
                                        <span ng-if="project.mergeInfo.status == '0'" style="color: green;">成功</span>
                                        <span ng-if="project.mergeInfo.status == '1'" style="color: red;">失败</span>
                                        <span ng-if="project.mergeInfo.status == null">未合并</span>
                                    </td>
                                    <td>
                                        {{project.mergeInfo.update_date|create_date_filter}}
                                    </td>
                                    <td>
                                        {{project.mergeInfo.desc}}
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <!--转测记录-->
                        <div class="tab-pane fade" id="tab8" ng-class="{true:'in active',false:''}[info.tabIndex == 8]">
                            <br>
                            <table width="50%">
                                <tr>
                                    <td width="5%">
                                        <input type="search" ng-model="search.project_name" style="width: 220px;"
                                               placeholder="Search Project Name Here..."/>
                                    </td>
                                    <td width="5%">
                                        解决阻塞bug:
                                        <select ng-model="search.is_handle_bug">
                                            <option value="">全部</option>
                                            <option value="0">是</option>
                                            <option value="1">否</option>
                                        </select>
                                    </td>
                                    <td width="5%">
                                        共 <span style="color: #1b9dec;">{{getLength(info.PHORecord,search)}}</span> 条记录
                                    </td>
                                </tr>
                            </table>
                            <br>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="5%">工程</th>
                                    <th width="5%">版本</th>
                                    <th width="5%">提交时间</th>
                                    <th width="5%">提交人</th>
                                    <th width="5%">解决阻塞bug</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr class="item"
                                    data-ng-repeat="record in info.PHORecord |filter:search">
                                    <td>{{record.project_name}}</td>
                                    <td>{{record.edition_num}}</td>
                                    <td>{{record.create_date| create_date_filter}}</td>
                                    <td>{{record.hand_realname}}</td>
                                    <td>
                                        <span ng-if="record.is_handle_bug == '0'" style="color: red;">是</span>
                                        <span ng-if="record.is_handle_bug == '1'">否</span>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="tab-pane fade" id="tab9" ng-class="{true:'in active',false:''}[info.tabIndex == 9]">
                            <u-test-record is-project='false' project-name='info.test'></u-test-record>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/ng-template" id="config.html">
    <div class="modal-header">
        <img src="/beetle/image/icon_plus-box.png" ng-click="add();" style="cursor: pointer;">
    </div>
    <div class="modal-body">
        <div data-ng-repeat="c in info.configList track by $index" ng-if="c.isDel=='0'">
            <br>
            <input type="text" style="width: 10%" placeholder="文件名" ng-model="c.file_name"/>:
            <input type="text" style="width: 10%" placeholder="配置项描述" ng-model="c.desc"/>:
            <input type="text" style="width: 10%" placeholder="配置项key" ng-model="c.key"/>=
            <input type="text" style="width: 10%" placeholder="配置项value" ng-model="c.value"/>
            资源类型:
            <select ng-model="c.config_type">
                <option value="URL">URL</option>
                <option value="端口">端口</option>
                <option value="其他">其他</option>
            </select>
            取值:
            <select ng-model="c.value_from">
                <option value="参考代码">参考代码</option>
                <option value="根据环境">根据环境</option>
            </select>
            修改类型:
            <select ng-model="c.type">
                <option value="1">新增</option>
                <option value="2">删除</option>
                <option value="3">修改</option>
            </select>
            <img src="/beetle/image/icon_trash.png" ng-click="del($index);" style="cursor: pointer;width: 20px;">
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" type="button" ng-click="cancel()">取消</button>
        <button class="btn btn-primary" type="button" ng-click="submit()">确定</button>
    </div>
</script>
<script type="text/ng-template" id="sql.html">
    <div class="modal-header">
    </div>
    <div class="modal-body">
        <div data-ng-repeat="s in info.sqlList track by $index" ng-if="!s.isDel">
            <br>
            <a href="javascript:void(0)" ng-click="downloadFile(s.file_name,s.file_path);"
               title="下载文件">{{s.file_name}}</a>
            <img src="/beetle/image/icon_trash.png" ng-click="del($index,info.trunk_name,s.file_name);"
                 style="cursor: pointer;width: 20px;">
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" type="button" ng-click="cancel()">关闭</button>
    </div>
</script>
<script type="text/ng-template" id="plan.html">
    <div class="modal-header">
        <span>需要的项目不存在？点击创建项目 >>>>></span>
        <i class="glyphicon glyphicon-plus-sign" uib-popover="创建项目"
           ng-click="createPlan();" popover-trigger="mouseenter" style="font-size: 18px;margin-left: 20px;"></i>
    </div>
    <div class="modal-body">
        <input type="text" ng-model="info.selectPlan" placeholder="Select Plan"
               uib-typeahead="plan as plan.plan_name for plan in info.planList | filter:{plan_name:$viewValue}|limitTo:15"
               typeahead-template-url="selectTemplate.html" class="form-control" typeahead-show-hint="true"
               typeahead-min-length="0" typeahead-on-select="planSelect();" typeahead-select-on-blur="true">
        <br>
        <span style="color: red;" ng-if="info.errMsg != null">{{info.errMsg}}</span>
        <br><span style="color: blue;">注:只有转测项目才能进入集成计划</span>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" type="button" ng-click="cancel()">关闭</button>
        <button class="btn btn-primary" ng-disabled="info.errMsg != null" type="button" ng-click="save()">确定</button>
    </div>
</script>
<script type="text/ng-template" id="sqlAnalyse.html">
    <div class="modal-header">
        SQL分析
    </div>
    <div class="modal-body">
        文件名:{{info.file_name}}
        <br>
        <table style="table-layout: fixed;" class="table table-hover table-bordered">
            <thead>
            <tr>
                <th width="8%">行号</th>
                <th width="92%">内容</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="i in info.analyse track by $index">
                <td>{{i.row_num}}</td>
                <td style="word-wrap: break-word;">{{i.row}}</td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" type="button" ng-click="cancel()">关闭</button>
    </div>
</script>
<script type="text/ng-template" id="sqlRecord.html">
    <div class="modal-header">
        SQL抽取记录
    </div>
    <div class="modal-body">
        <uib-accordion close-others="false">
            <uib-accordion-group heading="{{info.project_name}}" is-open="true">
                <table class="table table-hover table-bordered">
                    <thead>
                    <tr>
                        <th>抽取时间</th>
                        <th>抽取状态</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="i in info.sqlRecord track by $index" ng-click="clickRecord(i);"
                        ng-class="{true:'edition_click',false:''}[i.click]">
                        <td>{{i.draw_time| create_date_filter}}</td>
                        <td>
                            <span ng-show="i.status == '1'">成功</span>
                            <span ng-show="i.status == '0'">失败</span>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </uib-accordion-group>
            <uib-accordion-group heading="抽取详情" is-open="true" ng-if="info.selectRecord != null">
                <span ng-show="info.msg != ''">{{info.msg}}</span>
                <span ng-hide="info.msg != ''">
                    注：1、svn修改时间是该文件在svn上的最后一次更新的时间。本地修改时间是在beetle内执行构建时保存的文件的修改时间。
                        理论上讲，svn修改时间应该比本地修改时间早。如果svn修改时间比本地修改时间晚，说明svn上有可能更新了sql脚本，
                        但是并没有重新构建。
                </span>
                <br>
                <br>
                <table style="table-layout: fixed;" ng-hide="info.msg != ''" class="table table-hover table-bordered">
                    <thead>
                    <tr>
                        <th>文件名</th>
                        <th>描述</th>
                        <th>文件大小(B)</th>
                        <th>svn修改时间</th>
                        <th>本地修改时间</th>
                        <th>MD5</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="i in info.recordList track by $index">
                        <td style="word-wrap: break-word;">{{i.file_name}}</td>
                        <td style="word-wrap: break-word;">
                            <span ng-if="i.desc == 'NO'">无修改</span>
                            <span ng-if="i.desc == 'ADD'" style="color: red;">新增文件</span>
                            <span ng-if="i.desc == 'UPDATE'" style="color: red;">文件被修改</span>
                            <span ng-if="i.desc == 'DEL'" style="color: red;">文件被删除</span>
                        </td>
                        <td style="word-wrap: break-word;">
                            {{i.info.file_size}}
                        </td>
                        <td style="word-wrap: break-word;">
                            {{i.info.modify_date}}
                        </td>
                        <td style="word-wrap: break-word;">
                            {{i.info.file_modify_date}}
                        </td>
                        <td style="word-wrap: break-word;">
                            {{i.info.md5}}
                        </td>
                    </tr>
                    </tbody>
                </table>
            </uib-accordion-group>
        </uib-accordion>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" type="button" ng-click="cancel()">关闭</button>
    </div>
</script>